<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="css/style.css" />
<link type="text/css" rel="stylesheet" href="css/layout.css" />
<title>List category !</title>
</head>

<body>
<?php include("menu.php"); ?>

<div id="head-noidung">
	<div id="head-main">
	
	<?php
include ("../include/config.php");
?>

<p>Danh sách thành viên quản trị hệ thống Admin | <a class="copyrighta" href="themusers.php"> Thêm mới</a></p>
<table class="classtable" style="width:65%">
<thead>
	<tr>
		<th>STT</th>
		<th>Category</th>
		<th>Trạng tái</th>
		<th>Thao tác</th>

	</tr>
</thead>

<?php
$SQL="SELECT *FROM category ORDER BY stt";
$rs = mysql_query($SQL);
if($rs)
	{ $i=1;
		while($row=mysql_fetch_array($rs))
		
	{
?>

<tbody>
<tr>
	<td><?php echo $i?> </td>
	<td align="left"><?php echo $row["name"]?></td>
	<td><?php if($row["status"]==1) { ?> <img src="images/yes.png" width="23" height="22"/><?php } else { ?> <img src="images/no.png" width="23" height="22"/> <?php } ?></td>
	<td>
		<a class="copyrighta" href="category_edit.php?id=<?php echo $row["id"]?>">Sửa</a>|
		<a class="copyrighta" href="category_del.php?id=<?php echo $row["id"]?> ">Xóa</a>
	</td>
</tr>

<?php
$SQL2="SELECT * FROM subcategory WHERE parent_id=" . $row['id'] . " ORDER BY stt";
$rs2 = mysql_query($SQL2);
if($rs2) {
		$j = 1;
			while($rw2 = mysql_fetch_array($rs2))	{
			?>
				<tr>
					<td></td>
					<td align="left"><?php echo $j?>.<?php echo $rw2['name']?></td>
	<td><?php if($rw2["status"]==1) { ?> <img src="images/yes.png" width="23" height="22"/><?php } else { ?> <img src="images/no.png" width="23" height="22"/> <?php } ?></td>
					<td>
						<a href="subcategory_edit.php?id=<?php echo $rw2['id']?>">Sửa</a> | 
						<a href="subcategory_del.php?id=<?php echo $rw2['id']?>" onclick="return confirm('Bạn có chắc muốn xóa ?');">Xóa</a>

					</td>
				</tr>

<?php
$j += 1; }

			}
		
 $i++;}	}  ?>







</tbody>






</table>



	
	</div>	
</div>

<?php include("images/cherry/footer.php"); ?>

</body>
</html>
